home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Description:
- // This script creates menu items to add objects to bakeSets.
- //
-
-
- global proc string createBakeSet (string $name, string $type)
- {
- string $selectionList[] = `ls -selection`;
-
- // Create the bakeSet node.
- //
- string $bakeSetName = `createNode -n $name $type`;
-
- // Add the new bakeSet to the appropriate partition.
- //
- if( $type == "vertexBakeSet" )
- {
- if( size(`ls vertexBakePartition`) < 1 )
- {
- partition -n "vertexBakePartition" $bakeSetName;
- }
- else
- {
- partition -add "vertexBakePartition" $bakeSetName;
- }
-
- // Add two dynamic attributes to the vertexBakeSet node.
- //
- addAttr -ln filterSize -sn fs -min 0 $bakeSetName;
- setAttr ($bakeSetName+".filterSize") 0.001;
- addAttr -ln filterNormalTolerance -sn fns
- -min 0 -max 180 $bakeSetName;
- setAttr ($bakeSetName+".filterNormalTolerance") 5;
- }
- else
- {
- if( size(`ls textureBakePartition`) < 1 )
- {
- partition -n "textureBakePartition" $bakeSetName;
- }
- else
- {
- partition -add "textureBakePartition" $bakeSetName;
- }
- }
-
- // Restore the selection list.
- select -r $selectionList;
-
- return $bakeSetName;
- }
-
-
-